#define _CRT_SECURE_NO_WARNINGS 1


#include<stdio.h>
#include<string.h>


int main()
{
	int n = 0, i = 0, len = 0;
	scanf("%d", &n);
	getchar();
	char arr[100] = { 0 };
	while (n--)
	{
		scanf("%s", arr);
		if (arr[0] >= 'a' && arr[i] <= 'z')
			arr[0] += 32;
		len = strlen(arr);
		for (i = 1; i < len; i++)
		{
			if (arr[i] >= 'A' && arr[i] <= 'Z')
				arr[i] += 32;
		}
	}
	puts(arr);

	return 0;
}